<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>事件的基本使用</title>
    <script type="text/javascript" src="../js/vue.js"></script>
</head>
<body>
    <!--准备好一个容器-->
    <div id = "root">
       <h2>你好,{{name}}.欢迎来到三里屯</h2>
       <button v-on:click="showInfo">点我提示信息</button>
       <button @click="showInfo1">点我提示信息(不传参)</button>
       <button @click="showInfo2($event,66)">点我提示信息(传参)</button>
    </div>
</body>
<script type="text/javascript">
    new Vue({
      el:'#root', 
      data: { 
name:'李明'
      },
      methods: {
        showInfo(){
            alert("我是不传参的复杂写法")
        },
        showInfo1(){
            console.log(event)
            alert("我是不传参的简写写法")
        },
        showInfo2(event,number){
            alert("我是传参的简写写法"+number)
        },
      },
    })
</script>
</html>